package jerry.file.demo;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;

public class FileUtil {

	public static BufferedReader getBufferedReader(String filePath, String charset) throws FileNotFoundException, UnsupportedEncodingException{
		FileInputStream fileInputStream = new FileInputStream(filePath);
		BufferedReader reader = new BufferedReader(new InputStreamReader(fileInputStream, charset), 81920);
		return reader;
	}
	
	public static BufferedWriter getBufferedWriter(String filePath, String charset) throws FileNotFoundException, UnsupportedEncodingException{
		FileOutputStream fileOutputStream = new FileOutputStream(filePath);
		BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(fileOutputStream, charset));
		return bufferedWriter;
	}
	
	public static String getFileCharset(String filePath){
		String charsset = "";
		
		
		return charsset;
	}
}
